<template>
  <!-- HR管理 -->
  <div>
    <!-- 搜索容器 -->
    <div class="search-container">
      <span class="search-label">企业：</span>
      <el-input v-model="enterpriseInput" placeholder="请输入内容" class="search-input"></el-input>

      <span class="search-label">账号：</span>
      <el-input v-model="accountInput" placeholder="请输入内容" class="search-input"></el-input>

      <el-button type="primary" class="search-button">查询</el-button>
      <el-button type="success" class="search-button">重置</el-button>
      
  
    </div>

    <!-- 表格：增加状态列 -->
    <el-table :data="tableData" border style="width: 100%; margin-top: 15px;" :header-cell-style="{ textAlign: 'center' }"
      :cell-style="{ textAlign: 'center' }">
      <el-table-column prop="date" label="hr所属企业"></el-table-column>
      <el-table-column prop="name" label="hr账号"></el-table-column>
      <el-table-column prop="province" label="hr身份"></el-table-column>
      
      <!-- 新增状态列（倒数第二列） -->
      <el-table-column prop="status" label="状态">
        <template slot-scope="scope">
          <el-tag :type="scope.row.status === '正常' ? 'success' : 'danger'">
            {{ scope.row.status }}
          </el-tag>
        </template>
      </el-table-column>
      
      <el-table-column label="hr操作" width="180">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">重置密码</el-button>
          <el-button type="text" size="small">封禁hr</el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 分页组件 -->
    <el-pagination class="pagination-left" background layout="prev, pager, next" :total="1000"></el-pagination>
  </div>
</template>

<script>
export default {
  methods: {
    handleClick(row) {
      console.log(row);
    }
  },
  data() {
    return {
      enterpriseInput: '',  // 企业输入框绑定值
      accountInput: '',     // 账号输入框绑定值
      statusValue: '',      // 状态下拉框绑定值
      tableData: [{
        date: '企业A',
        name: 'user001',
        province: '管理员',
        status: '正常'  // 新增状态数据
      }, {
        date: '企业B',
        name: 'user002',
        province: '普通HR',
        status: '正常'  // 新增状态数据
      }, {
        date: '企业C',
        name: 'user003',
        province: '管理员',
        status: '封禁'  // 新增状态数据
      }, {
        date: '企业D',
        name: 'user004',
        province: '普通HR',
        status: '正常'  // 新增状态数据
      }]
    }
  }
}
</script>

<style scoped>
/* 搜索容器样式 */
.search-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}

.search-label {
  white-space: nowrap;
  font-size: 14px;
  color: #606266;
}

.search-input {
  width: 200px;
}

.search-button {
  margin-left: 10px;
}

/* 状态下拉框样式 */
.status-select {
  width: 120px;
  margin-left: 10px;
}

/* 表格样式 */
.el-table th {
  height: 70px !important;
  line-height: 70px !important;
}

.el-table {
  margin-top: 15px;
}

.el-table__header-wrapper th {
  background-color: #f5f7fa;
}

/* 分页样式 */
.pagination-left {
  margin-top: 15px;
  text-align: left;
}
</style>
    